package com.changeover.gwt.client.event;

import com.changeover.gwt.shared.model.customer.ICustomer;
import com.google.gwt.event.shared.GwtEvent;

public class CustomerDetailsEvent extends GwtEvent<ICustomerDetailsEventHandler> {
    public static final Type<ICustomerDetailsEventHandler> TYPE = new Type<ICustomerDetailsEventHandler>();
    
    private ICustomer customer;
    
    public CustomerDetailsEvent(ICustomer customer) {
        this.customer = customer;
    }

    @Override
    public Type<ICustomerDetailsEventHandler> getAssociatedType() {
        return TYPE;
    }
    
    public ICustomer getCustomer() {
        return customer;
    }

    @Override
    protected void dispatch(ICustomerDetailsEventHandler handler) {
        handler.onDoubleClickTable(this, customer);
    }
}
